package simulador.astarTestcase;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Scenario.java
 *
 * Created on Oct 31, 2009, 12:11:28 PM
 */
import java.util.*;
/**
 *
 * @author rangel
 */
class Atom {
	private int x, y;
	public double custo = 1.0;
	public Atom(int x, int y, double custo)
	{
		this.x=x;this.y=y;this.custo=custo;
	}
	public double custo()
	{
		return this.custo;
	}
	public String toString() {
		return ("("+x+", "+y+")");
	}
}
class Scenario {

	static private int width = 10;
	static private int height = 10;
	static private Atom[][] matriz;

	static public double getCostGrid(int x, int y) {
		System.out.println("x="+x+", y="+y);
		return matriz[y][x].custo();
	}

	static public Atom getAtom(int x, int y) {
		return matriz[y][x];
	}

	static public int getWidth() {
		return width;
	}
	static public int getHeight() {
		return height;
	}
	public static void main(String[] argv)
	{
		matriz = new Atom[height][width];
		for(int j=0; j < height; j++)
		{
			for(int i=0; i < width; i++)
			{
				matriz[j][i] = new Atom(i, j, 1.0);
			}
		}
		matriz[1][1].custo = 0.0;
		AStar estrela = new AStar();
		//estrela.setScenario(this);
		estrela.setCurrentPos(0,0);
		estrela.setGoal(9,9);
		List<Atom> cam=estrela.bestPath();
		for(Iterator it=cam.iterator();it.hasNext();) {
			System.out.println(it.next());
		}
	}
}

